<template>
  <div>

    <!-- Form -->
    <el-button type="primary" @click="dialogFormVisible = true">增加房间类型</el-button>

    <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
      <el-form :model="form">
        <el-form-item label="类型名称" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="可住人数" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>

        <center>
            <el-table
              :data="tableData"
              stripe
              style="width: 100%">
              <el-table-column
                prop="type_id"
                label="id"
                width="180">
              </el-table-column>

              <el-table-column
                prop="type_name"
                label="类型名"
                width="180">
              </el-table-column>
              <el-table-column
                prop="type_num"
                label="房间人数"
                width="180">
              </el-table-column>
            </el-table>
        </center>
  </div>

</template>

<script>
export default {
  methods:{
    loadData() {
      this.$axios
        .get("/roomtype", {

        })
        .then((res) => {
          this.tableData = res.data.data;
        })
        .catch((error) => {

        });
    },
  },
  data(){
    return{
      tableData:[

      ],

      dialogFormVisible: false,
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      formLabelWidth: '120px'
    }
  },
  mounted(){

    this.loadData();
  },
}
</script>

<style scoped>

</style>
